Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hr elements does not accept multiple classes #133

Merged
merged 2 commits into from
Dec 30, 2021
Merged

Conversation

tlylt
Copy link
Contributor

@tlylt tlylt commented Dec 28, 2021

Hi @arve0,
after looking at the code more carefully, the issue discussed in #131 turns out to be in markdown-it-attrs. It's a very minor bug that only affects hr elements. I am working on a project that uses markdown-it-attrs (Thank you 😃), hence putting up this PR to fix the issue at the root.


This PR fixes #131

Like other elements, hr elements should also allow multiple
classes to be added. Currently, hr elements have a direct
assignment of attributes in patterns.js. Thus, multiple
class attributes are not combined into one.

By using the utils.addAttrs method, the attribute values
will be merged correctly.

This bug fix helps with attributes on hr elements.
Example:--- {.a .b}
Before:<hr class='a' class='b'>
After: <hr class='a b'>

PS:
I am not sure if I should update browser.js, please feel free to let me know if it needs to be done:)

Like other elements, hr elements should also allow multiple
classes to be added. Currently, hr elements have a direct
assignment of attributes in patterns.js. Thus, multiple
class attributes are not combined into one.

By using the `utils.addAttrs` method, the attribute values
will be merged correctly.

This bug fix helps with attributes on hr elements.
Example:`--- {.a .b}`
Before:`<hr class='a' class='b'>`
After: `<hr class='a b'>`
@arve0 arve0 merged commit 833d55e into arve0:master Dec 30, 2021
@arve0
Copy link
Owner

arve0 commented Dec 30, 2021

Hi 👋 Thanks for the bug fix and the clear and concise description 👏

I am not sure if I should update browser.js, please feel free to let me know if it needs to be done:)

No need, it should build when bumping version 🙂

Changes released in v4.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to add multiple classes for <hr>
2 participants